﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            #region 一维数组
            int[] array1 = new int[10];
            int[] array2 = new int[10];
            for (int i = 0; i < 10; i++)
            {
                array1[i] = i;
            }
            for (int j = 0; j < array1.Length; j++)
            {
                array2[j] = (j + 1) * 100;
            }
            foreach (int x in array2)
            {
                Console.WriteLine($"{x}\t");
            }
            Console.WriteLine("=====一维数组=========");
            #endregion
            #region system.array 类
            Console.WriteLine(array1.Max());
            Console.WriteLine(array1.Min());
            foreach (int x1 in array1.Reverse())
            {
                Console.WriteLine($"{x1}\t");
            }
            Console.WriteLine("=====包装类=========");
            #endregion
            #region 多维数组
            int[,] array3 = new int[3, 4];
            int[,,] array4 = new int[3, 4, 5];
            for (int i = 0; i < array3.GetLength(0); i++)
            {
                for (int j = 0; j < array3.GetLength(1); j++)
                {
                    array3[i, j] = (i + 1) * (j + 1);
                    Console.WriteLine($"{array3[i,j]}\t");
                }
            }
            Console.WriteLine("=====二维数组=========");
            #endregion
            #region 数组的数组
            int[][] array5 = new int[3][];
            //初始化   ctrl+c+k,注释
            //for (int i = 0; i < 3; i++)
            //{
            //    array5[0] = new int[4]; //为每个数组元素创建4个数组元素
            //}
            array5[0] = new int[2] { 1, 2 };
            array5[1] = new int[3] { 1, 2,3 };
            array5[2] = new int[4] { 1, 2,3,4 };
            foreach (int[] arr in array5)
            {
                foreach (int x3 in arr)
                {
                    Console.WriteLine($"{x3}\t");
                }
            }
            #endregion
            Console.ReadKey();
        }
    }
}
